﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class MovcarFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As MovcarBE
        Dim tmpMovcar As MovcarBE = New MovcarBE()
        Try
            With tmpMovcar
                .Aduana = convertDTFromDb.ConvertString(dr.Item("Aduana"))
                .CantDev = convertDTFromDb.ConvertDecimal(dr.Item("CantDev"))
                .Cantidad = convertDTFromDb.ConvertDecimal(dr.Item("Cantidad"))
                .Chofer = convertDTFromDb.ConvertString(dr.Item("Chofer"))
                .ClaProducto = convertDTFromDb.ConvertString(dr.Item("ClaProducto"))
                .Costo = convertDTFromDb.ConvertDecimal(dr.Item("Costo"))
                .Descripcion = convertDTFromDb.ConvertString(dr.Item("Descripcion"))
                .Economico = convertDTFromDb.ConvertString(dr.Item("Economico"))
                .FaltaF = convertDTFromDb.ConvertString(dr.Item("FaltaF"))
                .FechaPed = convertDTFromDb.ConvertString(dr.Item("FechaPed"))
                .IdEmpresa = convertDTFromDb.convertInt32(dr.Item("IdEmpresa"))
                .IEPS = convertDTFromDb.ConvertDecimal(dr.Item("IEPS"))
                .KM = convertDTFromDb.ConvertString(dr.Item("KM"))
                .Matricula = convertDTFromDb.ConvertString(dr.Item("Matricula"))
                .NoPedimento = convertDTFromDb.ConvertString(dr.Item("NoPedimento"))
                .Numero = convertDTFromDb.convertInt32(dr.Item("Numero"))
                .NumOrig = convertDTFromDb.convertInt32(dr.Item("NumOrig"))
                .NumSerie = convertDTFromDb.ConvertString(dr.Item("NumSerie"))
                .Observac = convertDTFromDb.ConvertString(dr.Item("Observac"))
                .Origen = convertDTFromDb.ConvertString(dr.Item("Origen"))
                .Partida = convertDTFromDb.convertInt32(dr.Item("Partida"))
                .PartOrig = convertDTFromDb.convertInt32(dr.Item("PartOrig"))
                .PorcDesc = convertDTFromDb.ConvertDecimal(dr.Item("ProcDesc"))
                .PorcIVA = convertDTFromDb.ConvertDecimal(dr.Item("PorcIVA"))
                .PrecioUnitario = convertDTFromDb.ConvertDecimal(dr.Item("PrecioUnitario"))
                .Pzas = convertDTFromDb.ConvertDecimal(dr.Item("Pzas"))
                .Saldo = convertDTFromDb.ConvertDecimal(dr.Item("Saldo"))
                .SerieOrig = convertDTFromDb.ConvertString(dr.Item("SerieOrig"))
                .SerieR = convertDTFromDb.ConvertString(dr.Item("SerieR"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .Tipo = convertDTFromDb.ConvertString(dr.Item("Tipo"))
                .Unidad = convertDTFromDb.ConvertString(dr.Item("Unidad"))
            End With
            Return tmpMovcar
        Catch ex As Exception
            Throw
        Finally
            tmpMovcar = Nothing
        End Try
    End Function
End Class
